package com.hksj.base.controller;


import com.hksj.base.query.ProductQuery;
import com.hksj.base.service.DefaultProductService;
import com.hksj.base.vo.ProductVO;
import com.hksj.common.core.model.Rest;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Api(tags = "通用-产品列表")
@RestController
@RequestMapping("/api/comm/product")
public class DefaultProductController {

    @Autowired
    private DefaultProductService defaultProductService;

    @ApiOperation("查询专业中的产品列表")
    @PostMapping("/listProduct")
    public Rest<List<ProductVO>> listProduct(@RequestBody ProductQuery query){
        List<ProductVO> list = defaultProductService.listProduct(query);
        return Rest.ok(list);
    }
}
